-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
uudoc: print tldr.zip warning only once per process #10039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Could you please add a test to verify this? Thanks |
|
Per process? |
2d242c2 to
5af84b3
Compare
This comment was marked as resolved.
This comment was marked as resolved.
|
Hi @sylvestre, since it's now in build.rs do I still need to do unit tests? What's the best way to do unit tests for build.rs? I made manual tests with |
Move the tldr.zip missing warning from runtime (uudoc.rs) to compile time (build.rs). This ensures the warning is printed only once during the build, instead of 100+ times when make calls uudoc separately for each utility. Fixes uutils#9940
5af84b3 to
83e37bb
Compare
|
@oech3 thanks, |
|
GNU testsuite comparison: |
|
I tried to run both GNU tests locally and they passed, maybe it needs a retry? |
|
It is intermittent failure and merge main delays review. |
I think you can count the word |
Move the tldr.zip missing warning from runtime (
uudoc.rs) to compile time (build.rs). This ensures the warning is printed only once during the build, instead of 100+ times whenmakecallsuudocseparately for each utility.The Problem
From issue #9940:
The previous
OnceLockapproach did not work becausemake install-manpagesinvokesuudoc manpage <utility>as a separate process for each utility. Since each process has its own memory,OnceLockresets every time.The Fix
Check for
docs/tldr.zipinbuild.rsand emit acargo:warning=message at compile time:This prints the warning exactly once when
cargo build --features uudocruns, not during the 100+ runtime invocations.Testing
Build prints the warning once:
Running
uudoc manpagefor multiple utilities (simulatingmake install-manpages) prints no warnings:Fixes #9940